{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>诊疗界面</title>
    <!-- 引入 layui.css -->
    <link href="{%static '/css/layui.css'%}" rel="stylesheet">
</head>
<body>


<!--诊疗工具栏-->
<script id="zhenliaoBar" type="text/html">
    <button type="button" class="layui-btn layui-btn-sm layui-btn-primary" id="enter_btn" lay-event="enter_event">
        诊疗
    </button>
</script>

    <div class="layui-container">
        <h1>诊疗界面详细信息</h1>
        <table class="layui-table" style="height:full-150" id="infoTable"></table>
    </div>

<!-- 引入 layui.js -->
<script src="{%static '/js/layui.min.js'%}" charset="utf-8"></script>
<script>
    layui.use(['layer','jquery','table'], function () {
        var $ = layui.jquery,
            layer = layui.layer,
            table = layui.table;
        layer.msg('进入诊疗界面')
        table.render({
           elem:"#infoTable",
           url:"/api/cloud/hospital/",
           height:'full-215',
           page:true,
           cols:[[
               {toolbar:'#zhenliaoBar',title:"操作",width:100,fixed:'left'},
               {title:'序号',width:70,type:"numbers"},
               {field:'name',title:"诊疗机构" },

           ]],
           //修改参数
           request:{
               "pageName":"pageNum",
               "limitName":"pageSize"
           },
           response:{
               statusName:'code',     //数据状态的字段名称，默认：codes
               countName: 'count',    //数据总数的字段名称，默认：count
               dataName:'data',       //数据列表的字段名称，默认：data
           },
           parseData:function(res){
               d = {
                   "code":0,
                   "count":res.data.count,
                   "data":res.data.results
               }
               return d
           }
        });
    });
</script>
</body>
</html>